home *** CD-ROM | disk | FTP | other *** search
/ Gigarom 1 / Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso / FILES / HYP / C-D / DartmouthXCMDs.cpt / Dartmouth XCMDs Vol 1&2 / card_9472.txt < prev    next >
Text File  |  1989-02-26  |  4KB  |  163 lines

  1. -- card: 9472 from stack: in
  2. -- bmap block id: 9799
  3. -- flags: 0000
  4. -- background id: 8327
  5. -- name: XScrollBoxM
  6. ----- HyperTalk script -----
  7. on opencard
  8.   set the visible of field 1 to false -- background field
  9.   set the scroll of card field 1 to 0
  10.   set the scroll of card field 2 to 0
  11. end opencard
  12. on closecard
  13.   set the visible of field 1 to true
  14. end closecard
  15.  
  16.  
  17. -- part 2 (field)
  18. -- low flags: 00
  19. -- high flags: 4007
  20. -- rect: left=384 top=62 right=290 bottom=491
  21. -- title width / last selected line: 0
  22. -- icon id / first selected line: 0 / 0
  23. -- text alignment: 0
  24. -- font id: 3
  25. -- text size: 9
  26. -- style flags: 0
  27. -- line height: 12
  28. -- part name: scroller
  29.  
  30.  
  31. -- part 3 (button)
  32. -- low flags: 00
  33. -- high flags: 8003
  34. -- rect: left=79 top=298 right=320 bottom=179
  35. -- title width / last selected line: 0
  36. -- icon id / first selected line: 0 / 0
  37. -- text alignment: 1
  38. -- font id: 0
  39. -- text size: 12
  40. -- style flags: 0
  41. -- line height: 16
  42. -- part name: XScrollBoxM
  43. ----- HyperTalk script -----
  44. on mouseUp
  45.   put empty into msg
  46.   put "1,3,5" into initial
  47.   get XScrollBoxM(initial,"Choose one of these:",card field "scroller","Help")
  48.   if it is "Help" then
  49.     put "You pushed the 'Help' button."
  50.   else if it is empty then
  51.     put "You pushed the 'Cancel' button."
  52.   else
  53.     put "Your choice was: " & it
  54.   end if
  55. end mouseUp
  56.  
  57.  
  58.  
  59. -- part 5 (field)
  60. -- low flags: 01
  61. -- high flags: 2007
  62. -- rect: left=18 top=32 right=290 bottom=384
  63. -- title width / last selected line: 0
  64. -- icon id / first selected line: 0 / 0
  65. -- text alignment: 0
  66. -- font id: 20
  67. -- text size: 12
  68. -- style flags: 0
  69. -- line height: 16
  70. -- part name: XCMD Text
  71.  
  72.  
  73. -- part contents for card part 2
  74. ----- text -----
  75. able
  76. baker
  77. charlie
  78. dog
  79. ernest
  80. fox
  81. gamma
  82. horse
  83. ice cream
  84. jumping jack flash
  85. knockwurst
  86. liver
  87. monkey
  88. no way, jose
  89. occularity
  90. penelope
  91. qwerty
  92. rapscallion
  93. salubrious
  94. twinkle toes
  95. underwhelmed
  96. vermin
  97. wascally wabbit
  98. yokel
  99. zenzational
  100.  
  101. -- part contents for card part 5
  102. ----- text -----
  103. XScrollBoxM version 1.7
  104. Roger Brown
  105.  
  106. XScrollBoxM is a version HyperCard XFCN XScrollBox that allows the user to make multiple selections.
  107.  
  108.  The return value is an item list in the format:
  109.     number,text,number,text,..number,text
  110.    
  111.    where number is the number of a selection 
  112.      text is the text of the selection with that number
  113.    
  114.     Selection can be made by:
  115.    
  116.    1. double-clicking on a line.
  117.    2. single-clicking on a line, then pressing the OK button.
  118.    3. single-clicking on a line, then pressing the Return key.
  119.    4. typing the first letter(s) of a selection, then doing 1,2, or 3.
  120.      (Note: type selection assumes that the lines are   
  121.                 ordered  alphabetically)
  122.    5. scrolling with up and down arrow keys, then doing 1,2 or 3.
  123.  
  124.    Multiple selection is made by holding down the shift key while    
  125.    clicking.
  126.    
  127.    If the Cancel button is pressed, a null string is returned.
  128.    
  129.    It requires that the DITL and DLOG resources (1347) packaged with   
  130.    it are in the stack.
  131.    
  132.   The dialog is centered on the screen and sized to hold the width of the   
  133.    longest line and/or the prompt line, whichever is widest. It will not 
  134.    overrun the width of a  Mac+ screen.
  135.  
  136. INVOKING XScrollBoxM
  137.  
  138.   get XScrollBoxM(first,prompt,container,userButton)
  139.         
  140.    where  first  is a list of 1 or more default selections in the list - either      
  141.                   numbers or an item list of text strings (0 if none).
  142.                   NOTE: the text must exactly match what is in the field!
  143.                prompt is a string to prompt the user. This appears at the top                      
  144.                    of the dialog box.
  145.                container is any hypercard container (field, variable), 
  146.                    presumed to be multi-lined.
  147.                UserButton  is the name for an optional author specified 
  148.                    button. If this button is pressed, its name is returned             
  149.                    further processing by the script.  
  150.                    
  151.  
  152. EXAMPLE
  153.  
  154.  ex.  get XScrollBoxM("1,2,3","Choose:",card field 1,"Help")
  155.         if OK is pressed, returns : 1,text of line 1 of card field 1,2,text of     
  156.         line 2 of card field 1,3,ext of line 3 of card field 3
  157.  
  158.  
  159. REVISION HISTORY
  160. 1.4 - start with XScrollBox 1.4
  161. 1.6 - multiple selection by command-shift
  162. 1.7 -- 6/5/88   multiple selection by shift only
  163.